package cn.roadtrip.mtravelbusinessmodule.mvc.basic;

import cn.roadtrip.mtravelbusinessmodule.bs.basic.UserInforImpl;
import cn.roadtrip.utilmodule.util.DataBean;
import cn.roadtrip.utilmodule.util.ValidControllerAnn;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserInforController {

    @Autowired
    private UserInforImpl userInforImpl;


    /**
     * 保存用户信息
     *
     * @param model
     * @return
     */
    @RequestMapping("/saveSelfProfile")
    @ValidControllerAnn
    public DataBean saveSelfProfile(@RequestBody UserInforImpl.Model_saveSelfProfile model) {
        return userInforImpl.saveSelfProfile(model);
    }


    /**
     * 获取自己得信息
     *
     * @param model
     * @return
     */
    @RequestMapping("/getSelfProfile")
    @ValidControllerAnn
    public DataBean getSelfProfile(@RequestBody UserInforImpl.Model_getSelfProfile model) {
        return userInforImpl.getSelfProfile(model);
    }

    /**
     * 获取微信手机号
     *
     * @param model
     * @return
     */
    @RequestMapping("/getWchatTelByCode")
    @ValidControllerAnn
    public DataBean getWchatTelByCode(@RequestBody UserInforImpl.Model_getWchatTelByCode model) {
        return userInforImpl.getWchatTelByCode(model);
    }

}
